﻿using System;
using System.Collections.Generic;
using System.Reflection;
using CoreEx.Database.Metadata;

namespace CoreEx.Database.Mapping
{
    /// <summary>
    /// Represents a class that is capable of mapping the properties of 
    /// a <see cref="Type"/> to a list of <see cref="PropertyMappingInfo"/> instances.
    /// </summary>
    public interface IPropertyInfoMapper
    {
        /// <summary>
        /// Maps the properties from the <paramref name="type"/> parameter
        /// to a list of <see cref="PropertyMappingInfo"/> instances.
        /// </summary>
        /// <param name="type">The type that contains the properties to be mapped.</param>
        /// <param name="tableInfo">The <see cref="TableInfo"/> instance that corresponds to the <paramref name="type"/>.</param>
        /// <returns>A list of <see cref="PropertyMappingInfo"/> instances.</returns>
        IDictionary<PropertyInfo, PropertyMappingInfo> MapFrom(Type type, TableInfo tableInfo);
    }
}
